package com.mkvld.appietijdenv2;

import android.os.Bundle;
import android.view.MenuItem;

import com.mkvld.appietijdenv2.FragBreaksV14;
import com.mkvld.appietijdenv2.FragSettingsV14;
import com.mkvld.appietijdenv2.activities.ActV9;
import com.mkvld.appietijdenv2.fragments.FragInfoV9;

public class ActBlankV14 extends ActV9 {
	public static final int FRAG_SETTINGS = 0;
	public static final int FRAG_BREAKS = 1;
	public static final int FRAG_INFO = 2;
	@Override
		protected void onCreate(Bundle arg0) {
			super.onCreate(arg0);
			
			getActionBar().setDisplayHomeAsUpEnabled(true);
			
			switch (getIntent().getIntExtra("frag", -1)) {
			case FRAG_SETTINGS:
				FragSettingsV14 settingsFrag = new FragSettingsV14();
				getFragmentManager().beginTransaction()
					.replace(android.R.id.content, settingsFrag)
					.commit();
				break;
			case FRAG_BREAKS:
				FragBreaksV14 breaksFrag = new FragBreaksV14();
				getFragmentManager().beginTransaction()
					.replace(android.R.id.content, breaksFrag)
					.commit();
				break;
			case FRAG_INFO:
				FragInfoV9 infoFrag = new FragInfoV9();
				getSupportFragmentManager().beginTransaction()
					.replace(android.R.id.content, infoFrag)
					.commit();
				break;
			}
		}
	
	@Override
	public void update() {
		
	}

	@Override
	protected boolean shouldInit() {
		return false;
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		if (item.getItemId() == android.R.id.home) {
			finish();
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
